package cn.tedu.tcc;

import io.seata.rm.tcc.api.BusinessActionContext;
import io.seata.rm.tcc.api.BusinessActionContextParameter;
import io.seata.rm.tcc.api.LocalTCC;
import io.seata.rm.tcc.api.TwoPhaseBusinessAction;

import java.math.BigDecimal;

@LocalTCC
public interface StroageTccAution {
    @TwoPhaseBusinessAction(name = "StroageTccAution")
    boolean prepare(BusinessActionContext ctx,//第一阶段
                    //这个注解的作用是将 orderId 放入上下文对象
                    @BusinessActionContextParameter(paramName = "productId") Long productId,
                    @BusinessActionContextParameter(paramName = "count") Integer count);

    boolean commit(BusinessActionContext ctx);//第二阶段
    boolean rollback(BusinessActionContext ctx);
}
